3.1.6 \(\int \csc (c+d x) (a+a \sec (c+d x)) \, dx\) [6]

Optimal. Leaf size=30 \[ \frac {a \log (1-\cos (c+d x))}{d}-\frac {a \log (\cos (c+d x))}{d} \]

[Out]

a*ln(1-cos(d*x+c))/d-a*ln(cos(d*x+c))/d

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {3957, 2915, 12, 36, 31, 29} \begin {gather*} \frac {a \log (1-\cos (c+d x))}{d}-\frac {a \log (\cos (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]*(a + a*Sec[c + d*x]),x]

[Out]

(a*Log[1 - Cos[c + d*x]])/d - (a*Log[Cos[c + d*x]])/d

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2915

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2)*(c + (d/b)*x
)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, c, d, m, n}, x] && IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2,
 0]

Rule 3957

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Co
s[e + f*x])^p*((b + a*Sin[e + f*x])^m/Sin[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int \csc (c+d x) (a+a \sec (c+d x)) \, dx &=-\int (-a-a \cos (c+d x)) \csc (c+d x) \sec (c+d x) \, dx\\ &=\frac {a \text {Subst}\left (\int \frac {a}{(-a-x) x} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a^2 \text {Subst}\left (\int \frac {1}{(-a-x) x} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=-\frac {a \text {Subst}\left (\int \frac {1}{-a-x} \, dx,x,-a \cos (c+d x)\right )}{d}-\frac {a \text {Subst}\left (\int \frac {1}{x} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a \log (1-\cos (c+d x))}{d}-\frac {a \log (\cos (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(63\) vs. \(2(30)=60\).
time = 0.03, size = 63, normalized size = 2.10 \begin {gather*} -\frac {a \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {a \log \left (\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}-\frac {a (\log (\cos (c+d x))-\log (\sin (c+d x)))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]*(a + a*Sec[c + d*x]),x]

[Out]

-((a*Log[Cos[c/2 + (d*x)/2]])/d) + (a*Log[Sin[c/2 + (d*x)/2]])/d - (a*(Log[Cos[c + d*x]] - Log[Sin[c + d*x]]))
/d

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 15, normalized size = 0.50

method result size
derivativedivides \(\frac {a \ln \left (-1+\sec \left (d x +c \right )\right )}{d}\) \(15\)
default \(\frac {a \ln \left (-1+\sec \left (d x +c \right )\right )}{d}\) \(15\)
risch \(\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(38\)
norman \(\frac {2 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) \(54\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)*(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*a*ln(-1+sec(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 26, normalized size = 0.87 \begin {gather*} \frac {a \log \left (\cos \left (d x + c\right ) - 1\right ) - a \log \left (\cos \left (d x + c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

(a*log(cos(d*x + c) - 1) - a*log(cos(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]
time = 2.66, size = 31, normalized size = 1.03 \begin {gather*} -\frac {a \log \left (-\cos \left (d x + c\right )\right ) - a \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

-(a*log(-cos(d*x + c)) - a*log(-1/2*cos(d*x + c) + 1/2))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int \csc {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \csc {\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sec(d*x+c)),x)

[Out]

a*(Integral(csc(c + d*x)*sec(c + d*x), x) + Integral(csc(c + d*x), x))

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 58, normalized size = 1.93 \begin {gather*} \frac {a \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - a \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

(a*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)) - a*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 1)))
/d

________________________________________________________________________________________

Mupad [B]
time = 0.12, size = 17, normalized size = 0.57 \begin {gather*} \frac {2\,a\,\mathrm {atanh}\left (1-2\,\cos \left (c+d\,x\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(c + d*x))/sin(c + d*x),x)

[Out]

(2*a*atanh(1 - 2*cos(c + d*x)))/d

________________________________________________________________________________________